<template>
  <div class="product-wrap">
    <ul class="product">
      <li v-for="(item,index) in liData2" :key="index" @click="goComponent3(item)">
        <a>
          <p>{{item.text}}</p>
        </a>
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  name: "Component2",
  data() {
    return {
      liData2: [
        { text: "面部剃须刀2" },
        { text: "哈哈2" },
        { text: "哈哈哈2" },
        { text: "哈哈哈哈2" },
        { text: "哈哈哈哈哈2" },
        { text: "哈2" },
        { text: "哈哈2" },
        { text: "哈哈哈2" },
        { text: "哈哈哈哈2" },
        { text: "哈哈哈哈哈2" },
        { text: "哈哈哈哈2" },
        { text: "哈哈哈哈哈2" }
      ]
    };
  },
  methods:{
    goComponent3(item){
      this.$router.push({path:'Component3',query:{name2:item.text}})
    }
  }
};
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
.product-wrap {
    width: 80%;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    margin: 120px auto;
  }

  .hide {
    /*重要*/
    position: absolute;
    top: 0px;
    left: 0px;
  }

  .product-wrap ul {
    clear: both;
    width: 100%;
    display: inline-block;
  }

  .product-wrap ul li {
    width: 25%;
    float: left;
    text-align: center;
    margin-bottom: 22px;
    box-sizing: border-box;
    padding-right: 22px;
    cursor: pointer;
  }

  .product-wrap ul li:nth-child(4n + 4) {
    padding-right: 0px;
  }

  .product-wrap ul li a {
    border: 1px solid #b3c8e6;
    display: block;
  }

  .product-wrap ul li a p {
    position: relative;
    min-height: 66px;
    line-height: 66px;
    background: #0066a1;
    color: #fff;
    box-shadow: none;
    margin: 0;
  }

  .product-wrap .product li:nth-child(8n - 6) a p,
  .product-wrap .product li:nth-child(8n - 3) a p,
  .product-wrap .product li:nth-child(8n - 1) a p,
  .product-wrap .product li:nth-child(8n - 4) a p {
    background: #0086d4;
  }
</style>
